#ifndef __LCD_H
#define __LCD_H

#ifdef __cplusplus
extern "C" {
#endif

#include "main.h"

// OLED参数定义
#define OLED_WIDTH 128
#define OLED_HEIGHT 64
#define OLED_PAGES (OLED_HEIGHT/8)

// OLED命令定义
#define OLED_CMD_SET_CONTRAST        0x81
#define OLED_CMD_DISPLAY_RAM        0xA4
#define OLED_CMD_DISPLAY_ALLON        0xA5
#define OLED_CMD_DISPLAY_NORMAL        0xA6
#define OLED_CMD_DISPLAY_INVERSE    0xA7
#define OLED_CMD_DISPLAY_OFF        0xAE
#define OLED_CMD_DISPLAY_ON        0xAF
#define OLED_CMD_SET_PAGEADDR        0x22
#define OLED_CMD_SET_COLUMN_LOW    0x00
#define OLED_CMD_SET_COLUMN_HIGH    0x10
#define OLED_CMD_SET_STARTLINE        0x40

// 函数声明
void LCD_Init(void);
void LCD_Clear(void);
void LCD_ShowString(uint8_t x, uint8_t y, const char *str);
void LCD_WriteCmd(uint8_t cmd);
void LCD_WriteData(uint8_t data);
void LCD_SetPos(uint8_t x, uint8_t y);
void LCD_Fill(uint8_t fill_Data);
void LCD_ShowChar(uint8_t x, uint8_t y, uint8_t chr, uint8_t size);
void LCD_ShowNum(uint8_t x, uint8_t y, uint32_t num, uint8_t len, uint8_t size);

#ifdef __cplusplus
}
#endif

#endif /* __LCD_H */ 